#coding:utf-8
# -*- coding: utf-8 -*-
#@Time : 2020/11/5 19:10
#@Author: 王鹏-wangpeng99
#@File : TreeTest.py

from treelib import Node, Tree
tree = Tree()
tree.create_node("Harry", "harry")  # root node
tree.create_node("Jane", "jane", parent="harry")
tree.create_node("Bill", "bill", parent="harry")
tree.create_node("Diane", "diane", parent="jane")
tree.create_node("Mary", "mary", parent="diane")
tree.create_node("Mark", "mark", parent="jane")
tree.show()
print(len(tree))
subtree = tree.leaves()
print(subtree)